# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CachedContent do
  @moduledoc """
  A resource used in LLM queries for users to explicitly specify what to cache and how to cache.

  ## Attributes

  *   `contents` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content.t)`, *default:* `nil`) - Optional. Input only. Immutable. The content to cache
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Creation time of the cache entry.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Immutable. The user-generated meaningful display name of the cached content.
  *   `expireTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.
  *   `model` (*type:* `String.t`, *default:* `nil`) - Immutable. The name of the `Model` to use for cached content. Currently, only the published Gemini base models are supported, in form of projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}
  *   `name` (*type:* `String.t`, *default:* `nil`) - Immutable. Identifier. The server-generated resource name of the cached content Format: projects/{project}/locations/{location}/cachedContents/{cached_content}
  *   `systemInstruction` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content.t`, *default:* `nil`) - Optional. Input only. Immutable. Developer set system instruction. Currently, text only
  *   `toolConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ToolConfig.t`, *default:* `nil`) - Optional. Input only. Immutable. Tool config. This config is shared for all tools
  *   `tools` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tool.t)`, *default:* `nil`) - Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response
  *   `ttl` (*type:* `String.t`, *default:* `nil`) - Input only. The TTL for this resource. The expiration time is computed: now + TTL.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. When the cache entry was last updated in UTC time.
  *   `usageMetadata` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CachedContentUsageMetadata.t`, *default:* `nil`) - Output only. Metadata on the usage of the cached content.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :contents =>
            list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content.t()) | nil,
          :createTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :expireTime => DateTime.t() | nil,
          :model => String.t() | nil,
          :name => String.t() | nil,
          :systemInstruction =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content.t() | nil,
          :toolConfig =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ToolConfig.t() | nil,
          :tools => list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tool.t()) | nil,
          :ttl => String.t() | nil,
          :updateTime => DateTime.t() | nil,
          :usageMetadata =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CachedContentUsageMetadata.t()
            | nil
        }

  field(:contents, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content, type: :list)
  field(:createTime, as: DateTime)
  field(:displayName)
  field(:expireTime, as: DateTime)
  field(:model)
  field(:name)
  field(:systemInstruction, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content)
  field(:toolConfig, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ToolConfig)
  field(:tools, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tool, type: :list)
  field(:ttl)
  field(:updateTime, as: DateTime)

  field(:usageMetadata,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CachedContentUsageMetadata
  )
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CachedContent do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CachedContent.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CachedContent do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
